﻿<Window x:Class="Dispatcher.Views.UserEditView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="UserEditView" Height="230" Width="330">
    <Window.Resources>
        <DataTemplate x:Key="ComboBoxItemTemplate">
            <TextBlock Text="{Binding Path=Name}" ToolTip="{Binding Path=Description}"  Width="Auto"/>
        </DataTemplate>
        <DataTemplate x:Key="ComboBoxItemTemplate1">
            <TextBlock Text="{Binding Path=FirstName}" ToolTip="{Binding Path=Description}"  Width="Auto"/>
        </DataTemplate>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>


        <TextBlock Margin="5" Grid.Row="1" Grid.Column="0" Text="Логин"/>
        <TextBlock Margin="5" Grid.Row="2" Grid.Column="0" Text="Пароль"/>
        <TextBlock Margin="5" Grid.Row="4" Grid.Column="0" Text="Персона"/>
        <TextBlock Margin="6" Grid.Row="5" Grid.Column="0" Text="Роль" Name="Organazer"/>
        <TextBlock Margin="6" Grid.Row="6" Grid.Column="0" Text="Участники" Visibility="Collapsed"/>
        <TextBox Grid.Column="1" Grid.Row="1" Margin="5" Text="{Binding Name, Mode=TwoWay}"/>
        <TextBox Grid.Column="1" Grid.Row="2" Margin="5" Text="{Binding PasswordHash, Mode=TwoWay}"/>
        <ComboBox Grid.Column="1" Grid.Row="4" Margin="5" Name="Combo1" ItemsSource="{Binding Path=Persons}" SelectedItem="{Binding SelectedPerson, Mode=TwoWay}" SelectedIndex="0" IsReadOnly="True" ItemTemplate="{StaticResource ComboBoxItemTemplate1}"/>
        <ComboBox Grid.Column="1" Grid.Row="5" Margin="5" Name="Combo2" ItemsSource="{Binding Path=Roles}" SelectedItem="{Binding SelectedOrganizePerson, Mode=TwoWay}" IsReadOnly="True" ItemTemplate="{StaticResource ComboBoxItemTemplate}"/>
      
        <StackPanel Margin="5" Grid.Column="1" Grid.Row="10" Orientation="Horizontal">
            <Button Margin="10" Width="77" Click="OkButton_Click">Ok</Button>
            <Button Margin="10" Width="77" Click="CancedlButton_Click">Cancel</Button>
        </StackPanel>

    </Grid>
</Window>
